<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>文章列表--layui后台管理模板</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">

    <link rel="stylesheet" href="//at.alicdn.com/t/font_tnyc012u2rlwstt9.css" media="all"/>
    <link rel="stylesheet" href="{:_SKIN}/shadmin/v3//css/news.css" media="all"/>
</head>
<body class="childrenBody">
<blockquote class="layui-elem-quote news_search">

    <div class="layui-inline">
        <div class="layui-input-inline" style="width: 200px">
            <input type="text" value="" placeholder="请输入商品名称或商家名称" class="layui-input search_input">
        </div>

    </div>
    <div class="layui-inline">
        <a class="layui-btn layui-btn-normal newsAdd_btn">搜索</a>
    </div>


    <div class="layui-inline">
        <a class="layui-btn layui-btn-danger batchDel">批量删除</a>
    </div>
    <div class="layui-inline">
        <div class="layui-form-mid layui-word-aux">　共找到 {$num} 个商家</div>
    </div>
</blockquote>
<div class="layui-form news_list">
    <table class="layui-table">
        <colgroup>
           
        </colgroup>
        <thead>
        <tr>
            <th></th>
            <th style="text-align:left;">企业名称</th>
            <th width="60px">企业法人</th>
            <th width="60px">企业固话</th>
            <th width="50px">手机</th>

            <th width="50px">企业邮箱</th>
            <th width="60px">营业执照</td>
            <th width="70px">法人身份证</th>
            <th width="60px">其他资质</th>
            <th>审核</th>
            <th width="100px">上传时间</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody class="news_content">
        {volist name="list" id="v"}
        <tr id="d{$v.id}">
            <td><input type="checkbox" name="checked" lay-skin="primary" lay-filter="choose">
                <div class="layui-unselect layui-form-checkbox" lay-skin="primary"><i class="layui-icon"></i></div>
            </td>
            <td align="left">{$v.qymc}  <a href="{:Url('productlist',['bid'=>$v['id']])}" class="layui-icon">&#xe615;</a></td>
            <td>{$v.qyfr}</td>
            <td>{$v.qydh}</td>
            <td>{$v.tel}</td>

             <td>{$v.qyyx}</td>
            <td><a data-url="{$v.yyzz}" class="layui-icon yl">&#xe615;</a></td>
            <td><a data-url="{$v.sfz}" class="layui-icon yl">&#xe615;</a></td>

            <td><a data-url="{$v.qt}" class="layui-icon yl">&#xe615;</a></td>
          {eq name="v.state" value="3"}
            <td><input type="checkbox" name="show" lay-skin="switch" lay-text="通过|拒绝" lay-filter="isShow"  data-id="{$v.id}"  checked=""></td>
          {else /}
            <td><input type="checkbox" name="show" lay-skin="switch" lay-text="通过|拒绝" lay-filter="isShow" data-id="{$v.id}" ></td>
            {/eq}



           <td>{$v.addtime}</td>

            <td>
              <a class="layui-btn layui-btn-mini bus_info"  href="{:url('business',['id'=>$v['id']])}">详情</a>

              <!-- <a class="layui-btn layui-btn-mini bus_info layui-btn-normal"  href="{:url('editbusiness',['id'=>$v['id']])}">编辑</a> -->

              <!-- <a class="layui-btn layui-btn-danger layui-btn-mini pro_del"  data-id="{$v.id}">删除</a> -->


            </td>
        </tr>
    {/volist}
        </tbody>
    </table>
</div>

<div id="page">{$page}</div>
{:jq()}
{:layui()}
<style>
    .pagination { margin-left: 50px;}
    .pagination li { float: left; background: #34a8fe; color: #fff; margin-right:8px ; }
    .pagination li a,.pagination li span { color:#fff;padding: 8px 10px;display: block}
    .pagination .active  { background-color: #fe6738}

</style>
<script>

  //删除商品
    $(".bus_info1").click(function(){
      var id=$(this).data('url');

      parent.layer.open({
          type: 2,
          area: ['760px', '450px'],
          fixed: false, //不固定
          maxmin: false,

          content: [id,"no"]
      });


  });


    $(".yl").click(function(){
  
  var img=$(this).data('url');
     parent.layer.open({
  type: 1,
  skin: 'layui-layer-rim', //加上边框
  area: ['90%', '80%'], //宽高
  content: '<img src="'+img+'" width="100%"  />'
});



    });

    //删除商品
    $(".pro_del").click(function () {
        var id = $(this).data('id');
        parent.layer.confirm("确定要删除该商品吗？删除后不可恢复", function () {

            $.post("{:url('dev/delapi')}", {t: 'user_shop',k:'id',v:id}, function (res) {

                if (res.code == 200) {


                    parent.layer.msg('删除成功', {shift: 0, time: 2000}, function () {

                        location.reload();
                    });

                } else {

                    parent.layer.msg(res.msg);

                }

            });


        });


    });


  //修改产品状态
    layui.form.on('switch(isShow)', function (data) {
        var id = $(data.elem).data('id');


        var key = data.elem.checked ? 3 : 4;

        $.post("{:url('dev/changeapi')}", {table:'user_shop',key: id, val: key}, function (res) {

            if (res.code != 200) {

                panent.layer.alert('网络繁忙，请重试');

            }

        });


    });
</script>
</body>
</html>